#include "ScriptGeneratorWizard.h"
#include<stdio.h>
ScriptGeneratorWizard::ScriptGeneratorWizard(bool advanced, QWidget *parent):QWizard(parent)
{
	m_usedScript = false;
	m_script = new ScriptEntryRaw;
	if(!advanced){
		setPage(PAGE_LINK, linkPage());
		setPage(PAGE_PHASEMASK, phaseMaskPage());
	}
	setPage(PAGE_CHANCE, chancePage());
	setPage(PAGE_EVENTFLAGS, eventFlagsPage());
	setPage(PAGE_EVENTTYPE, eventTypePage());
	setPage(PAGE_EVENTPARAMS, eventParametersPage());
	setPage(PAGE_ACTION, actionPage());
	setPage(PAGE_ACTIONPARAMS, actionParametersPage());
	setPage(PAGE_TARGET, targetTypePage());
	setPage(PAGE_TARGETPARAMS, targetParametersPage());
	setPage(PAGE_COMMENTS, commentsPage());
}

ScriptGeneratorWizard::~ScriptGeneratorWizard(){
	if(!m_usedScript)
		delete m_script;
	m_script = 0;
}

bool ScriptGeneratorWizard::validateCurrentPage(){
	unsigned flags = 0;
	switch(currentId()){
		case PAGE_LINK:
			m_script->add("link", m_editLink->text());
			break;
		case PAGE_PHASEMASK:
			m_script->add("event_phase_mask", m_editPhaseMask->text());
			break;
		case PAGE_CHANCE:
			m_script->add("ChanceOrQuestChance", m_editChance->text());
			break;
		case PAGE_EVENTFLAGS:
			if(m_checkRepeat->isChecked())
				flags += 0x1;
			if(m_check0->isChecked())
				flags += 0x2;
			if(m_check1->isChecked())
				flags += 0x4;
			if(m_check2->isChecked())
				flags += 0x8;
			if(m_check3->isChecked())
				flags += 0x10;
			if(m_checkDebug->isChecked())
				flags += 0x20;
			m_script->add("event_flags", QString().setNum(flags));
			break;
		case PAGE_EVENTTYPE:
			m_script->add("event_type", QString().setNum(m_comboEventType->currentIndex()));
			setEventTypeParameters(m_comboEventType->currentIndex());
			break;
		case PAGE_EVENTPARAMS:
			if(!m_editEventParam1->text().isEmpty())
				m_script->add("event_param1", m_editEventParam1->text());
			if(!m_editEventParam2->text().isEmpty())
				m_script->add("event_param2", m_editEventParam2->text());
			if(!m_editEventParam3->text().isEmpty())
				m_script->add("event_param3", m_editEventParam3->text());
			if(!m_editEventParam4->text().isEmpty())
				m_script->add("event_param4", m_editEventParam4->text());
			break;
		case PAGE_ACTION:
			m_script->add("action_type", QString().setNum(m_comboActionType->currentIndex()));
			setActionTypeParameters(m_comboActionType->currentIndex());
			break;
		case PAGE_ACTIONPARAMS:
			if(!m_actionParam1->text().isEmpty())
				m_script->add("action_param1", m_actionParam1->text());
			if(!m_actionParam2->text().isEmpty())
				m_script->add("action_param2", m_actionParam2->text());
			if(!m_actionParam3->text().isEmpty())
				m_script->add("action_param3", m_actionParam3->text());
			if(!m_actionParam4->text().isEmpty())
				m_script->add("action_param4", m_actionParam4->text());
			if(!m_actionParam5->text().isEmpty())
				m_script->add("action_param5", m_actionParam5->text());
			if(!m_actionParam6->text().isEmpty())
				m_script->add("action_param6", m_actionParam6->text());
			break;
		case PAGE_TARGET:
			m_script->add("target_type", QString().setNum(m_comboTarget->currentIndex()));
			setTargetTypeParameters(m_comboTarget->currentIndex());
			break;
		case PAGE_TARGETPARAMS:
			if(!m_editTarget1->text().isEmpty())
				m_script->add("target_param1", m_editTarget1->text());
			if(!m_editTarget2->text().isEmpty())
				m_script->add("target_param2", m_editTarget2->text());
			if(!m_editTarget3->text().isEmpty())
				m_script->add("target_param3", m_editTarget3->text());
			if(!m_editTargetX->text().isEmpty())
				m_script->add("target_x", m_editTargetX->text());
			if(!m_editTargetY->text().isEmpty())
				m_script->add("target_y", m_editTargetY->text());
			if(!m_editTargetZ->text().isEmpty())
				m_script->add("target_z", m_editTargetZ->text());
			if(!m_editTargetO->text().isEmpty())
				m_script->add("target_o", m_editTargetO->text());
			
			break;
		case PAGE_COMMENTS:
			if(m_comments->text().isEmpty()){
				QMessageBox::information(this, "Comments", "Comments are mandatory on my watch. Good comments are like: \"Mob XYZ - Cast spell whatever every x-y seconds.\" or \"Mob XYZ - Complete Quest upon death.\"");
				return false;
			}
			m_script->add("comment", QString("\"") + m_comments->text() + QString("\""));
			break;
	}
	return true;
}

ScriptEntryRaw *ScriptGeneratorWizard::getSQL(QString &sql, QString &comment){
	sql += "INSERT INTO smart_scripts (";
	QString trailer;
	for(int i = 0; i < m_script->count(); i++){
		QString key, value;
		m_script->get(i, key, value);
		sql += key + ", ";
		trailer += value + ", ";
	}
	sql += "entryorguid, source_type, id) VALUES (" + trailer;
	comment = m_comments->text();
	m_usedScript = true;
	return m_script;
}

QWizardPage *ScriptGeneratorWizard::linkPage(){
	QWizardPage *page = new QWizardPage(this);
	page->setTitle("Link");
	page->setSubTitle("ADVANCED - USE AT OWN RISK");

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	QLabel *label = new QLabel("This is used to link events together. If link were set to 1, for example, it could only occur if event 0 occurred before. Otherwise, if set to 5, it could only occur if event 4 occurred before.\n\nIf in doubt, just leave empty and proceed :-)");
	label->setWordWrap(true);
	layout->addWidget(label);

	m_editLink = new QLineEdit(page);
	m_editLink->setValidator(new QIntValidator(m_editLink));
	m_editLink->setText("0");
	layout->addWidget(m_editLink);

	return page;
}

QWizardPage *ScriptGeneratorWizard::phaseMaskPage(){
	QWizardPage *page = new QWizardPage(this);
	page->setTitle("PhaseMask");
	page->setSubTitle("ADVANCED - USE AT OWN RISK");

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	QLabel *label = new QLabel("The PhaseMask is used to have certain events only happen in some phases off the boss encounter. So say if a boss has three phases, you can use this to make him cast some spell only in phases one and two, for example.\n\nThe PhaseMask is a bit mask, I'll soon add some checkboxes to simplify the process.", page);
	label->setWordWrap(true);
	layout->addWidget(label);

	m_editPhaseMask = new QLineEdit(page);
	m_editPhaseMask->setValidator(new QIntValidator(m_editPhaseMask));
	layout->addWidget(m_editPhaseMask);
	m_editPhaseMask->setText("0");

	return page;
}

QWizardPage *ScriptGeneratorWizard::chancePage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Event Chance");

	QLabel *label = new QLabel("This is the chance that this event will occur.\n\nThis is handy, for example, on event AI Init, to randomly have it choose between several behaviours, allowing one AI to script more than one kind of behaviour. I'd say this kind of use is still advanced and should be discouraged until you're sure of what you're doing.", page);
	label->setWordWrap(true);
	layout->addWidget(label);

	m_editChance = new QLineEdit(page);
	layout->addWidget(m_editChance);
	m_editChance->setValidator(new QDoubleValidator(m_editChance));
	m_editChance->setText("100.0");

	return page;
}

QWizardPage *ScriptGeneratorWizard::eventFlagsPage(){
	QWizardPage *page = new QWizardPage(this);

	QGridLayout *layout = new QGridLayout(page);
	page->setLayout(layout);

	page->setTitle("Event Flags");

	QLabel *label = new QLabel("Alright, this might be a little tough, but it is important. Here are some \"flags\" you can set to influence the script's behaviour. It should be fairly straightforward.\n\nPlease do note that if an event is to occur within a certain dungeon, it's corresponding flag must be set! (like \"normal dungeon\", for example).\n\nYou should really think of this as an event, an action we will react to. Once X occurs, we do Y!\n", page);
	label->setWordWrap(true);
	layout->addWidget(label, 0, 0, 1, 2);

	m_checkRepeat = new QCheckBox("Cannot Repeat", page);
	m_check0 = new QCheckBox("Normal dungeon", page);
	m_check1 = new QCheckBox("Heroic dungeon", page);
	m_check2 = new QCheckBox("Normal raid", page);
	m_check3 = new QCheckBox("Heroic raid", page);
	m_checkDebug = new QCheckBox("Debug only", page);

	layout->addWidget(m_checkRepeat, 1, 0, 1, 1);
	layout->addWidget(m_check0, 2, 0, 1, 1);
	layout->addWidget(m_check1, 3, 0, 1, 1);
	layout->addWidget(m_check2, 1, 1, 1, 1);
	layout->addWidget(m_check3, 2, 1, 1, 1);
	layout->addWidget(m_checkDebug, 3, 1, 1, 1);

	return page;
}

QWizardPage *ScriptGeneratorWizard::eventTypePage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Event Type");

	QLabel *label = new QLabel("Now we've finally come to more interesting stuff. We're going to set the EVENT TYPE. In other words, we're now going to specify when this line of the script applies.\n\nAgain, in other words, if you're writing a script that makes a mob say \"I love you!\", when a player emotes /kiss to it, we would set event type \"Receive Emote\".\n", page);
	label->setWordWrap(true);
	layout->addWidget(label);

	m_comboEventType = new QComboBox(this);
	layout->addWidget(m_comboEventType);
	m_comboEventType->addItem("Timer In Combat");
	m_comboEventType->addItem("Timer Out Of Combat");
	m_comboEventType->addItem("Health Percent");
	m_comboEventType->addItem("Mana Percent");
	m_comboEventType->addItem("Aggro");
	m_comboEventType->addItem("Kill");
	m_comboEventType->addItem("Death");
	m_comboEventType->addItem("Evade");
	m_comboEventType->addItem("Spellhit");
	m_comboEventType->addItem("Range");
	m_comboEventType->addItem("Out of Combat LOS");
	m_comboEventType->addItem("Respawn");
	m_comboEventType->addItem("Target Health Percent");
	m_comboEventType->addItem("Target Casting");
	m_comboEventType->addItem("Friendly Health");
	m_comboEventType->addItem("Friendly Is CC");
	m_comboEventType->addItem("Friendly Missing Buff");
	m_comboEventType->addItem("Summoned Unit");
	m_comboEventType->addItem("Target Mana Percent");
	m_comboEventType->addItem("Accepted Quest");
	m_comboEventType->addItem("Reward Quest");
	m_comboEventType->addItem("Reached Home");
	m_comboEventType->addItem("Receive Emote");
	m_comboEventType->addItem("Has Aura");
	m_comboEventType->addItem("Target Buffed");
	m_comboEventType->addItem("Reset");
	m_comboEventType->addItem("In Combat LOS");
	m_comboEventType->addItem("Passenger Boarded");
	m_comboEventType->addItem("Passenger Removed");
	m_comboEventType->addItem("Charmed");
	m_comboEventType->addItem("Charmed Target");
	m_comboEventType->addItem("Spellhit Target");
	m_comboEventType->addItem("Damaged");
	m_comboEventType->addItem("Damaged Target");
	m_comboEventType->addItem("Movement Inform");
	m_comboEventType->addItem("Summon Despawned");
	m_comboEventType->addItem("Corpse Removed");
	m_comboEventType->addItem("AI Init");
	m_comboEventType->addItem("Data Set");
	m_comboEventType->addItem("Waypoint Start");
	m_comboEventType->addItem("Waypoint Reached");
	m_comboEventType->addItem("Transport Addplayer");
	m_comboEventType->addItem("Transport Addcreature");
	m_comboEventType->addItem("Transport Removeplayer");
	m_comboEventType->addItem("Transport Relocate");
	m_comboEventType->addItem("Instance Player Enter");
	m_comboEventType->addItem("Areatrigger Ontrigger");
	m_comboEventType->addItem("Quest Accepted");
	m_comboEventType->addItem("Quest Objective Completion");
	m_comboEventType->addItem("Quest Rewarded");
	m_comboEventType->addItem("Quest Fail");
	m_comboEventType->addItem("Text Over");
	m_comboEventType->addItem("Receive Heal");
	m_comboEventType->addItem("Just Summoned");
	m_comboEventType->addItem("Waypoint Paused");
	m_comboEventType->addItem("Waypoint Resumed");
	m_comboEventType->addItem("Waypoint Stopped");
	m_comboEventType->addItem("Waypoint Ended");
	m_comboEventType->addItem("Timed Event Triggered");
	m_comboEventType->addItem("Update");
	m_comboEventType->addItem("Link");
	m_comboEventType->addItem("Gossip Select");
	m_comboEventType->addItem("Just Created");
	m_comboEventType->addItem("Gossip Hello");
	m_comboEventType->addItem("Follow Completed");
	m_comboEventType->addItem("Dummy Effect");
	m_comboEventType->addItem("Is Behind Target");
	m_comboEventType->addItem("Game Event Start");
	m_comboEventType->addItem("Game Event End");
	m_comboEventType->addItem("GO State Changed");
	m_comboEventType->addItem("GO Event Inform");
	m_comboEventType->addItem("Action Done");

	return page;
}

QWizardPage *ScriptGeneratorWizard::eventParametersPage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Event Parameters");

	QLabel *label = new QLabel("These are the parameters you can set for chosen Event Type. For more documentation, please visit:", page);
	label->setWordWrap(true);
	layout->addWidget(label);

	QLineEdit *e = new QLineEdit(page);
	e->setText("http://collab.kpsn.org/display/tc/smart_scripts#smart_scripts-event_type");
	e->selectAll();
	//e->setDisabled(true);
	layout->addWidget(e);

	QWidget *w = new QWidget(page);
	w->setContentsMargins(0,0,0,0);
	layout->addWidget(w);
	QHBoxLayout *l = new QHBoxLayout(w);
	w->setLayout(l);

	QWidget* m_eventParamWidget1 = new QWidget(w);
	l->addWidget(m_eventParamWidget1);
	QVBoxLayout* m_eventParaml1 = new QVBoxLayout(m_eventParamWidget1);
	m_eventParamWidget1->setLayout(m_eventParaml1);

	m_editEventParam1 = new QLineEdit(m_eventParamWidget1);
	m_editEventParam1->setValidator(new QIntValidator(this));
	m_eventParaml1->addWidget(m_editEventParam1);
	m_editEventParam1->setText("0");

	QWidget* m_eventParamWidget2 = new QWidget(w);
	l->addWidget(m_eventParamWidget2);
	QVBoxLayout* m_eventParaml2 = new QVBoxLayout(m_eventParamWidget2);
	m_eventParamWidget2->setLayout(m_eventParaml2);

	m_editEventParam2 = new QLineEdit(m_eventParamWidget2);
	m_editEventParam2->setValidator(new QIntValidator(this));
	m_eventParaml2->addWidget(m_editEventParam2);
	m_editEventParam2->setText("0");

	QWidget* m_eventParamWidget3 = new QWidget(w);
	l->addWidget(m_eventParamWidget3);
	QVBoxLayout* m_eventParaml3 = new QVBoxLayout(m_eventParamWidget3);
	m_eventParamWidget3->setLayout(m_eventParaml3);

	m_editEventParam3 = new QLineEdit(m_eventParamWidget3);
	m_editEventParam3->setValidator(new QIntValidator(this));
	m_eventParaml3->addWidget(m_editEventParam3);
	m_editEventParam3->setText("0");

	QWidget* m_eventParamWidget4 = new QWidget(w);
	l->addWidget(m_eventParamWidget4);
	QVBoxLayout* m_eventParaml4 = new QVBoxLayout(m_eventParamWidget4);
	m_eventParamWidget4->setLayout(m_eventParaml4);

	m_editEventParam4 = new QLineEdit(m_eventParamWidget4);
	m_editEventParam4->setValidator(new QIntValidator(this));
	m_eventParaml4->addWidget(m_editEventParam4);
	m_editEventParam4->setText("0");

	m_eventParam1Description = new QLabel("", m_eventParamWidget1);
	m_eventParaml1->addWidget(m_eventParam1Description);

	m_eventParam2Description = new QLabel("", m_eventParamWidget2);
	m_eventParaml2->addWidget(m_eventParam2Description);

	m_eventParam3Description = new QLabel("", m_eventParamWidget3);
	m_eventParaml3->addWidget(m_eventParam3Description);

	m_eventParam4Description = new QLabel("", m_eventParamWidget3);
	m_eventParaml4->addWidget(m_eventParam4Description);

	setEventTypeParameters(m_comboEventType->currentIndex());

	return page;
}

void ScriptGeneratorWizard::setEventTypeParameters(int current){
	m_editEventParam1->setEnabled(true);
	m_editEventParam2->setEnabled(true);
	m_editEventParam3->setEnabled(true);
	m_editEventParam4->setEnabled(true);
	switch(current){
		case SMART_EVENT_UPDATE_IC:
		m_eventParam1Description->setText("init min");
		m_eventParam2Description->setText("init max");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_UPDATE_OOC:
		m_eventParam1Description->setText("init min");
		m_eventParam2Description->setText("init max");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_HEALT_PCT:
		m_eventParam1Description->setText("min hp %");
		m_eventParam2Description->setText("max hp %");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_MANA_PCT:
		m_eventParam1Description->setText("min mana %");
		m_eventParam2Description->setText("max mana %");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_AGGRO:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_KILL:
		m_eventParam1Description->setText("min cooldown");
		m_eventParam2Description->setText("max cooldown");
		m_eventParam3Description->setText("player only?");
		m_eventParam4Description->setText("creature ID");
		break;
		case SMART_EVENT_DEATH:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_EVADE:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_SPELLHIT:
		m_eventParam1Description->setText("spell ID");
		m_eventParam2Description->setText("spell school");
		m_eventParam3Description->setText("cooldown min");
		m_eventParam4Description->setText("cooldown max");
		break;
		case SMART_EVENT_RANGE:
		m_eventParam1Description->setText("min dist");
		m_eventParam2Description->setText("max dist");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_OOC_LOS:
		m_eventParam1Description->setText("No hostile?");
		m_eventParam2Description->setText("max range");
		m_eventParam3Description->setText("cooldown min");
		m_eventParam4Description->setText("cooldown max");
		break;
		case SMART_EVENT_RESPAWN:
		m_eventParam1Description->setText("type");
		m_eventParam2Description->setText("map ID");
		m_eventParam3Description->setText("zone ID");
		m_eventParam4Description->setText("");
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TARGET_HEALTH_PCT:
		m_eventParam1Description->setText("min hp %");
		m_eventParam2Description->setText("max hp %");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_TARGET_CASTING:
		m_eventParam1Description->setText("repeat min");
		m_eventParam2Description->setText("repeat max");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_FRIENDLY_HEALTH:
		m_eventParam1Description->setText("hp deficit");
		m_eventParam2Description->setText("radius");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_FRIENDLY_IS_CC:
		m_eventParam1Description->setText("radius");
		m_eventParam2Description->setText("repeat min");
		m_eventParam3Description->setText("repeat max");
		m_eventParam4Description->setText("");
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_FRIENDLY_MISSING_BUFF:
		m_eventParam1Description->setText("spell ID");
		m_eventParam2Description->setText("radius");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_SUMMONED_UNIT:
		m_eventParam1Description->setText("creature ID");
		m_eventParam2Description->setText("cooldown min");
		m_eventParam3Description->setText("cooldown max");
		m_eventParam4Description->setText("");
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TARGET_MANA_PCT:
		m_eventParam1Description->setText("min mana %");
		m_eventParam2Description->setText("max mana %");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_ACCEPTED_QUEST:
		m_eventParam1Description->setText("quest ID");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_REWARD_QUEST:
		m_eventParam1Description->setText("quest ID");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_REACHED_HOME:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_RECEIVE_EMOTE:
		m_eventParam1Description->setText("emote ID");
		m_eventParam2Description->setText("cooldown min");
		m_eventParam3Description->setText("cooldown max");
		m_eventParam4Description->setText("condition (?)");
		break;
		case SMART_EVENT_HAS_AURA:
		m_eventParam1Description->setText("spell ID");
		m_eventParam2Description->setText("stacks");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_TARGET_BUFFED:
		m_eventParam1Description->setText("spell ID");
		m_eventParam2Description->setText("stacks");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_RESET:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_IC_LOS:
		m_eventParam1Description->setText("No hostile?");
		m_eventParam2Description->setText("max range");
		m_eventParam3Description->setText("cooldown min");
		m_eventParam4Description->setText("cooldown max");
		break;
		case SMART_EVENT_PASSENGER_BOARDED:
		m_eventParam1Description->setText("cooldown min");
		m_eventParam2Description->setText("cooldown max");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_PASSENGER_REMOVED:
		m_eventParam1Description->setText("cooldown min");
		m_eventParam2Description->setText("cooldown max");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_CHARMED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_CHARMED_TARGET:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_SPELLHIT_TARGET:
		m_eventParam1Description->setText("spell ID");
		m_eventParam2Description->setText("school");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_DAMAGED:
		m_eventParam1Description->setText("min dmg");
		m_eventParam2Description->setText("max dmg");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_DAMAGED_TARGET:
		m_eventParam1Description->setText("min dmg");
		m_eventParam2Description->setText("max dmg");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_MOVEMENTINFORM:
		m_eventParam1Description->setText("MovementType");
		m_eventParam2Description->setText("point ID");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_SUMMON_DESPAWNED:
		m_eventParam1Description->setText("entry");
		m_eventParam2Description->setText("cooldown min");
		m_eventParam3Description->setText("cooldown max");
		m_eventParam4Description->setText("");
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_CORPSE_REMOVED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_AI_INIT:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_DATA_SET:
		m_eventParam1Description->setText("field");
		m_eventParam2Description->setText("value");
		m_eventParam3Description->setText("cooldown min");
		m_eventParam4Description->setText("cooldown max");
		break;
		case SMART_EVENT_WAYPOINT_START:
		m_eventParam1Description->setText("point id");
		m_eventParam2Description->setText("path id");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_WAYPOINT_REACHED:
		m_eventParam1Description->setText("point id");
		m_eventParam2Description->setText("path id");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TRANSPORT_ADDPLAYER:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TRANSPORT_ADDCREATURE:
		m_eventParam1Description->setText("entry");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TRANSPORT_REMOVE_PLAYER:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TRANSPORT_RELOCATE:
		m_eventParam1Description->setText("point id");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_INSTANCE_PLAYER_ENTER:
		m_eventParam1Description->setText("Team (0 if any)");
		m_eventParam2Description->setText("cooldown min");
		m_eventParam3Description->setText("cooldown max");
		m_eventParam4Description->setText("");
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_AREATRIGGER_ONTRIGGER:
		m_eventParam1Description->setText("Trigger id (0 if any)");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_QUEST_ACCEPTED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_QUEST_OBJ_COPLETETION:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_QUEST_COMPLETION:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_QUEST_REWARDED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_QUEST_FAIL:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TEXT_OVER:
		m_eventParam1Description->setText("Group id (from creature_text)");
		m_eventParam2Description->setText("creature ID (0 if any)");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_RECEIVE_HEAL:
		m_eventParam1Description->setText("min heal");
		m_eventParam2Description->setText("max heal");
		m_eventParam3Description->setText("cooldown min");
		m_eventParam4Description->setText("cooldown max");
		break;
		case SMART_EVENT_JUST_SUMMONED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_WAYPOINT_PAUSED:
		m_eventParam1Description->setText("point ID (0 if any)");
		m_eventParam2Description->setText("path ID (0 if any)");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_WAYPOINT_RESUMED:
		m_eventParam1Description->setText("point ID (0 if any)");
		m_eventParam2Description->setText("path ID (0 if any)");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_WAYPOINT_STOPPED:
		m_eventParam1Description->setText("point ID (0 if any)");
		m_eventParam2Description->setText("path ID (0 if any)");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_WAYPOINT_ENDED:
		m_eventParam1Description->setText("point ID (0 if any)");
		m_eventParam2Description->setText("path ID (0 if any)");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_TIMED_EVENT_TRIGGERED:
		m_eventParam1Description->setText("Id");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_UPDATE:
		m_eventParam1Description->setText("init min");
		m_eventParam2Description->setText("init max");
		m_eventParam3Description->setText("repeat min");
		m_eventParam4Description->setText("repeat max");
		break;
		case SMART_EVENT_LINK:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_GOSSIP_SELECT:
		m_eventParam1Description->setText("menu ID");
		m_eventParam2Description->setText("ID");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_JUST_CREATED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_GOSSIP_HELLO:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_FOLLOW_COMPLETED:
		m_eventParam1Description->setText("");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam1->setText("");
		m_editEventParam1->setDisabled(true);
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_DUMMY_EFFECT:
		m_eventParam1Description->setText("spell ID");
		m_eventParam2Description->setText("effect index");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_IS_BEHIND_TARGET:
		m_eventParam1Description->setText("cooldown min");
		m_eventParam2Description->setText("cooldown max");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_GAME_EVENT_START:
		m_eventParam1Description->setText("game_event.eventEntry");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_GAME_EVENT_END:
		m_eventParam1Description->setText("game_event.eventEntry");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_GO_STATE_CHANGED:
		m_eventParam1Description->setText("State");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_GO_EVENT_INFORM:
		m_eventParam1Description->setText("event ID");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_ACTION_DONE:
		m_eventParam1Description->setText("event ID");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_ON_SPELLCLICK:
		m_eventParam1Description->setText("clicker");
		m_eventParam2Description->setText("");
		m_eventParam3Description->setText("");
		m_eventParam4Description->setText("");
		m_editEventParam2->setText("");
		m_editEventParam2->setDisabled(true);
		m_editEventParam3->setText("");
		m_editEventParam3->setDisabled(true);
		m_editEventParam4->setText("");
		m_editEventParam4->setDisabled(true);
		break;
		case SMART_EVENT_FRIENDLY_HEALTH_PCT:
		m_eventParam1Description->setText("min hp %");
		m_eventParam2Description->setText("max hp %");
		m_eventParam3Description->setText("cooldown min");
		m_eventParam4Description->setText("cooldown max");
		break;
		default:
		QMessageBox::critical(0, "Bad shit happened!", "Something terrible happened selecting an event. Please contact Sanity!");
	}
}

QWizardPage *ScriptGeneratorWizard::actionPage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Action Type");

	QLabel *label = new QLabel("Alright, we have selected an event and its parameters, determining when we're going to do something. Here we determine what we're going to do. Please select the action that appears most appropriate to you.", page);
	label->setWordWrap(true);
	layout->addWidget(label);

	m_comboActionType = new QComboBox(page);
	layout->addWidget(m_comboActionType);
	m_comboActionType->addItem("Nothing");
	m_comboActionType->addItem("Talk");
	m_comboActionType->addItem("Set Faction");
	m_comboActionType->addItem("Morph to Entry or Model");
	m_comboActionType->addItem("Sound");
	m_comboActionType->addItem("Play Emote");
	m_comboActionType->addItem("Fail Quest");
	m_comboActionType->addItem("Add Quest");
	m_comboActionType->addItem("Set React State");
	m_comboActionType->addItem("Activate GameObject");
	m_comboActionType->addItem("Random Emote");
	m_comboActionType->addItem("Cast");
	m_comboActionType->addItem("Summon Creature");
	m_comboActionType->addItem("Threat Single Percent");
	m_comboActionType->addItem("Threat All Percent");
	m_comboActionType->addItem("Call AreaExplored or EventHappens");
	m_comboActionType->addItem("Send CastCreatureOrGo");
	m_comboActionType->addItem("Set Emote State");
	m_comboActionType->addItem("Set Unit Flag");
	m_comboActionType->addItem("Remove Unit Flag");
	m_comboActionType->addItem("Auto Attack");
	m_comboActionType->addItem("Allow Combat Movement");
	m_comboActionType->addItem("Set Event Phase");
	m_comboActionType->addItem("Inc Event Phase");
	m_comboActionType->addItem("Evade");
	m_comboActionType->addItem("Flee For Assist");
	m_comboActionType->addItem("Group Event Happens");
	m_comboActionType->addItem("Call CastedCreatureOrGo");
	m_comboActionType->addItem("RemoveAurasFromSpell");
	m_comboActionType->addItem("Follow");
	m_comboActionType->addItem("Random Phase");
	m_comboActionType->addItem("Random Phase Range");
	m_comboActionType->addItem("Reset GameObject");
	m_comboActionType->addItem("Call KilledMonster");
	m_comboActionType->addItem("Set Instance Data");
	m_comboActionType->addItem("Set Instance Data64");
	m_comboActionType->addItem("Update Template");
	m_comboActionType->addItem("Die");
	m_comboActionType->addItem("Set In Combat With Zone");
	m_comboActionType->addItem("Call For Help");
	m_comboActionType->addItem("Set Sheath");
	m_comboActionType->addItem("Force Despawn");
	m_comboActionType->addItem("Set Invinvibility HP Level");
	m_comboActionType->addItem("Mount To Entry Or Model");
	m_comboActionType->addItem("Set Ingame Phase Mask");
	m_comboActionType->addItem("Set Data");
	m_comboActionType->addItem("Move Forward");
	m_comboActionType->addItem("Set visibility");
	m_comboActionType->addItem("Set Active");
	m_comboActionType->addItem("Attack Start");
	m_comboActionType->addItem("Summon GameObject");
	m_comboActionType->addItem("Kill Unit");
	m_comboActionType->addItem("Activate Taxi");
	m_comboActionType->addItem("Waypoint Start");
	m_comboActionType->addItem("Waypoint Pause");
	m_comboActionType->addItem("Waypoint Stop");
	m_comboActionType->addItem("Add Item");
	m_comboActionType->addItem("Remove Item");
	m_comboActionType->addItem("Install AI Template");
	m_comboActionType->addItem("Set Run");
	m_comboActionType->addItem("Set Fly");
	m_comboActionType->addItem("Set Swim");
	m_comboActionType->addItem("Teleport");
	m_comboActionType->addItem("Store Variable Decimal");
	m_comboActionType->addItem("Store Target List");
	m_comboActionType->addItem("Waypoint Resume");
	m_comboActionType->addItem("Set Orientation");
	m_comboActionType->addItem("Create Timed Event");
	m_comboActionType->addItem("Play Movie");
	m_comboActionType->addItem("Move to Pos");
	m_comboActionType->addItem("Respawn Target");
	m_comboActionType->addItem("Equip");
	m_comboActionType->addItem("Close Gossip");
	m_comboActionType->addItem("Trigger Timed Event");
	m_comboActionType->addItem("Remove Timed Event");
	m_comboActionType->addItem("Add Aura");
	m_comboActionType->addItem("Override Script Base Object");
	m_comboActionType->addItem("Reset Script Base Object");
	m_comboActionType->addItem("Call Script Reset");
	m_comboActionType->addItem("Set Ranged Movement");
	m_comboActionType->addItem("Call Timed Actionlist");
	m_comboActionType->addItem("Set NPC Flag");
	m_comboActionType->addItem("Add NPC Flag");
	m_comboActionType->addItem("Remove NPC Flag");
	m_comboActionType->addItem("Simple Talk");
	m_comboActionType->addItem("Invoker Cast");
	m_comboActionType->addItem("Cross Cast");
	m_comboActionType->addItem("Call Random Timed Actionlist");
	m_comboActionType->addItem("Call Random Range Timed Actionlist");
	m_comboActionType->addItem("Random Move");
	m_comboActionType->addItem("Set Unit_Field_Bytes1");
	m_comboActionType->addItem("Remove Unit_Field_Bytes1");
	m_comboActionType->addItem("Interrupt Spell");
	m_comboActionType->addItem("Send Go Custom Animation");
	m_comboActionType->addItem("Set Dynamic Flag");
	m_comboActionType->addItem("Add Dynamic Flag");
	m_comboActionType->addItem("Remove Dynamic Flag");
	m_comboActionType->addItem("Jump To Pos");
	m_comboActionType->addItem("Send Gossip Menu");
	m_comboActionType->addItem("GameObject Set Loot State");
	m_comboActionType->addItem("Send Target To Target");
	m_comboActionType->addItem("Set Home Pos");
	m_comboActionType->addItem("Set Health Regen");
	m_comboActionType->addItem("Set Root");
	m_comboActionType->addItem("Set GameObject Flag");
	m_comboActionType->addItem("Add GameObject Flag");
	m_comboActionType->addItem("Remove GameObject Flag");
	m_comboActionType->addItem("Summon Creature Group");

	return page;
}

QWizardPage *ScriptGeneratorWizard::actionParametersPage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Action Parameters");
	
	QLabel *label = new QLabel("These are the parameters you can set for chosen Event Type. For more documentation, please visit:", page);
	label->setWordWrap(true);
	layout->addWidget(label);

	QLineEdit *e = new QLineEdit(page);
	e->setText("http://collab.kpsn.org/display/tc/smart_scripts#smart_scripts-action_type");
	e->selectAll();
	//e->setDisabled(true);
	layout->addWidget(e);
	
	QWidget *w = new QWidget(page);
	layout->addWidget(w);
	QHBoxLayout *l = new QHBoxLayout(w);
	w->setLayout(l);
	
	m_actionParamWidget1 = new QWidget(w);
	l->addWidget(m_actionParamWidget1);
	m_actionParamLayout1 = new QVBoxLayout(m_actionParamWidget1);
	m_actionParamWidget1->setLayout(m_actionParamLayout1);
	
	m_actionParamWidget2 = new QWidget(w);
	l->addWidget(m_actionParamWidget2);
	m_actionParamLayout2 = new QVBoxLayout(m_actionParamWidget2);
	m_actionParamWidget2->setLayout(m_actionParamLayout2);
	
	m_actionParamWidget3 = new QWidget(w);
	l->addWidget(m_actionParamWidget3);
	m_actionParamLayout3 = new QVBoxLayout(m_actionParamWidget3);
	m_actionParamWidget3->setLayout(m_actionParamLayout3);
	
	m_actionParamWidget4 = new QWidget(w);
	l->addWidget(m_actionParamWidget4);
	m_actionParamLayout4 = new QVBoxLayout(m_actionParamWidget4);
	m_actionParamWidget4->setLayout(m_actionParamLayout4);
	
	m_actionParamWidget5 = new QWidget(w);
	l->addWidget(m_actionParamWidget5);
	m_actionParamLayout5 = new QVBoxLayout(m_actionParamWidget5);
	m_actionParamWidget5->setLayout(m_actionParamLayout5);
	
	m_actionParamWidget6 = new QWidget(w);
	l->addWidget(m_actionParamWidget6);
	m_actionParamLayout6 = new QVBoxLayout(m_actionParamWidget6);
	m_actionParamWidget6->setLayout(m_actionParamLayout6);
	
	m_actionParam1 = new QLineEdit(m_actionParamWidget1);
	m_actionParam1->setValidator(new QDoubleValidator(m_actionParam1));
	m_actionParamLayout1->addWidget(m_actionParam1);
	m_actionParam2 = new QLineEdit(m_actionParamWidget2);
	m_actionParam2->setValidator(new QDoubleValidator(m_actionParam2));
	m_actionParamLayout2->addWidget(m_actionParam2);
	m_actionParam3 = new QLineEdit(m_actionParamWidget3);
	m_actionParam3->setValidator(new QDoubleValidator(m_actionParam3));
	m_actionParamLayout3->addWidget(m_actionParam3);
	m_actionParam4 = new QLineEdit(m_actionParamWidget4);
	m_actionParam4->setValidator(new QDoubleValidator(m_actionParam4));
	m_actionParamLayout4->addWidget(m_actionParam4);
	m_actionParam5 = new QLineEdit(m_actionParamWidget5);
	m_actionParam5->setValidator(new QDoubleValidator(m_actionParam5));
	m_actionParamLayout5->addWidget(m_actionParam5);
	m_actionParam6 = new QLineEdit(m_actionParamWidget6);
	m_actionParam6->setValidator(new QDoubleValidator(m_actionParam6));
	m_actionParamLayout6->addWidget(m_actionParam6);
	
	m_actionParam1Description = new QLabel("", m_actionParamWidget1);
	m_actionParamLayout1->addWidget(m_actionParam1Description);
	m_actionParam2Description = new QLabel("", m_actionParamWidget2);
	m_actionParamLayout2->addWidget(m_actionParam2Description);
	m_actionParam3Description = new QLabel("", m_actionParamWidget3);
	m_actionParamLayout3->addWidget(m_actionParam3Description);
	m_actionParam4Description = new QLabel("", m_actionParamWidget4);
	m_actionParamLayout4->addWidget(m_actionParam4Description);
	m_actionParam5Description = new QLabel("", m_actionParamWidget5);
	m_actionParamLayout5->addWidget(m_actionParam5Description);
	m_actionParam6Description = new QLabel("", m_actionParamWidget6);
	m_actionParamLayout6->addWidget(m_actionParam6Description);
	
	return page;
}

void ScriptGeneratorWizard::setActionTypeParameters(int current){
	m_actionParam1->setEnabled(true);
	m_actionParam2->setEnabled(true);
	m_actionParam3->setEnabled(true);
	m_actionParam4->setEnabled(true);
	m_actionParam5->setEnabled(true);
	m_actionParam6->setEnabled(true);
	switch(current){
		case SMART_ACTION_NONE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_TALK:
			m_actionParam1Description->setText("creature_text.groupid");
			m_actionParam2Description->setText("time before TEXT_OVER");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_FACTION:
			m_actionParam1Description->setText("factionID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("creature_template.modelID");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SOUND:
			m_actionParam1Description->setText("soundID");
			m_actionParam2Description->setText("only self?");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_PLAY_EMOTE:
			m_actionParam1Description->setText("emoteID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_FAIL_QUEST:
			m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_QUEST:
			m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_REACT_STATE:
			m_actionParam1Description->setText("State");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_ACTIVATE_GOBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_RANDOM_EMOTE:
			m_actionParam1Description->setText("emote id1");
			m_actionParam2Description->setText("emote id2");
			m_actionParam3Description->setText("emote id3");
			m_actionParam4Description->setText("emote id4");
			m_actionParam5Description->setText("emote id5");
			m_actionParam6Description->setText("emote id6");
			break;
		case SMART_ACTION_CAST:
			m_actionParam1Description->setText("spellID");
			m_actionParam2Description->setText("cast flags");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SUMMON_CREATURE:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("summonType");
			m_actionParam3Description->setText("duration");
			m_actionParam4Description->setText("storageID (always 0)");
			m_actionParam5Description->setText("attack invoker?");
			m_actionParam6Description->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_THREAT_SINGLE_PCT:
			m_actionParam1Description->setText("threat % inc");
			m_actionParam2Description->setText("threat % dec");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_THREAT_ALL_PCT:
			m_actionParam1Description->setText("threat % inc");
			m_actionParam2Description->setText("thread % dec");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS:
			m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_UNUSED_16:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			break;
		case SMART_ACTION_SET_EMOTE_STATE:
			m_actionParam1Description->setText("emote ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_UNIT_FLAG:
			m_actionParam1Description->setText("flags");
			m_actionParam2Description->setText("0 unit_flags, 1 unit_flags2");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_UNIT_FLAG:
			m_actionParam1Description->setText("flags");
			m_actionParam2Description->setText("0 unit_flags, 1 unit_flags2");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_AUTO_ATTACK:
			m_actionParam1Description->setText("0 stop, else continue");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_ALLOW_COMBAT_MOVEMENT:
			m_actionParam1Description->setText("0 stop, else continue");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_EVENT_PHASE:
			m_actionParam1Description->setText("smart_scripts.event_phase_mask");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_INC_EVENT_PHASE:
			m_actionParam1Description->setText("increment");
			m_actionParam2Description->setText("decrement");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_EVADE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_FLEE_FOR_ASSIST:
			m_actionParam1Description->setText("0 no text, 1 text");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_GROUPEVENTHAPPENS:
			m_actionParam1Description->setText("quest ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_CASTEDCREATUREORGO:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("spell ID");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVEAURASFROMSPELL:
			m_actionParam1Description->setText("spell ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_FOLLOW:
			m_actionParam1Description->setText("distance (0 default)");
			m_actionParam2Description->setText("angle (0 default)");
			m_actionParam3Description->setText("End creature_template.entry (?)");
			m_actionParam4Description->setText("credit");
			m_actionParam5Description->setText("credit type (0 kill, 1 event)");
			m_actionParam6Description->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_RANDOM_PHASE:
			m_actionParam1Description->setText("smart_scripts.event_phase_mask1");
			m_actionParam2Description->setText("smart_scripts.event_phase_mask2");
			m_actionParam3Description->setText("smart_scripts.event_phase_mask3");
			m_actionParam4Description->setText("smart_scripts.event_phase_mask4");
			m_actionParam5Description->setText("smart_scripts.event_phase_mask5");
			m_actionParam6Description->setText("smart_scripts.event_phase_mask6");
			break;
		case SMART_ACTION_RANDOM_PHASE_RANGE:
			m_actionParam1Description->setText("smart_scripts.event_phase_mask minimum");
			m_actionParam2Description->setText("smart_scripts.event_phase_mask maximum");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_RESET_GOBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_KILLEDMONSTER:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INST_DATA:
			m_actionParam1Description->setText("field");
			m_actionParam2Description->setText("data");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INST_DATA64:
			m_actionParam1Description->setText("field");
			m_actionParam2Description->setText("data64");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_UPDATE_TEMPLATE:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("Team");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_DIE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_FOR_HELP:
			m_actionParam1Description->setText("radius");
			m_actionParam2Description->setText("0 no text, 1 text");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_SHEATH:
			m_actionParam1Description->setText("0 unarmed, 1 melee, 2 ranged");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_FORCE_DESPAWN:
			m_actionParam1Description->setText("timer");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL:
			m_actionParam1Description->setText("flat hp value");
			m_actionParam2Description->setText("percent hp value");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL:
			m_actionParam1Description->setText("creature_template.entry");
			m_actionParam2Description->setText("creature_template.modelid");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_INGAME_PHASE_MASK:
			m_actionParam1Description->setText("creature.phaseMask");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_DATA:
			m_actionParam1Description->setText("field");
			m_actionParam2Description->setText("data");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_MOVE_FORWARD:
			m_actionParam1Description->setText("distance");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_VISIBILITY:
			m_actionParam1Description->setText("0 invis, 1 vis");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_ACTIVE:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_ATTACK_START:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam1->setDisabled(true);
			m_actionParam1->setText("");
			m_actionParam2->setDisabled(true);
			m_actionParam2->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_SUMMON_GO:
			m_actionParam1Description->setText("gameobject_template.entry");
			m_actionParam2Description->setText("despawntime");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
			m_actionParam3->setDisabled(true);
			m_actionParam3->setText("");
			m_actionParam4->setDisabled(true);
			m_actionParam4->setText("");
			m_actionParam5->setDisabled(true);
			m_actionParam5->setText("");
			m_actionParam6->setDisabled(true);
			m_actionParam6->setText("");
			break;
		case SMART_ACTION_KILL_UNIT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_ACTIVATE_TAXI:
	m_actionParam1Description->setText("taxi ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_WP_START:
	m_actionParam1Description->setText("0 walk, 1 run");
	m_actionParam2Description->setText("Waypoints.entry");
	m_actionParam3Description->setText("canRepeat");
	m_actionParam4Description->setText("quest_template.id");
	m_actionParam5Description->setText("despawntime");
	m_actionParam6Description->setText("reactstate");
			break;
		case SMART_ACTION_WP_PAUSE:
	m_actionParam1Description->setText("time");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_WP_STOP:
	m_actionParam1Description->setText("despawntime");
	m_actionParam2Description->setText("quest_template.id");
	m_actionParam3Description->setText("fail (0/1)");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_ITEM:
	m_actionParam1Description->setText("item_template.entry");
	m_actionParam2Description->setText("amount");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_ITEM:
	m_actionParam1Description->setText("item_template.entry");
	m_actionParam2Description->setText("amount");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_INSTALL_AI_TEMPLATE:
	m_actionParam1Description->setText("template ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_RUN:
	m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_FLY:
	m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_SWIM:
	m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_TELEPORT:
	m_actionParam1Description->setText("map ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_STORE_VARIABLE_DECIMAL:
	m_actionParam1Description->setText("var ID");
	m_actionParam2Description->setText("number");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_STORE_TARGET_LIST:
	m_actionParam1Description->setText("var ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_WP_RESUME:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_ORIENTATION:
	m_actionParam1Description->setText("orientation");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_CREATE_TIMED_EVENT:
	m_actionParam1Description->setText("id");
	m_actionParam2Description->setText("init min");
	m_actionParam3Description->setText("init max");
	m_actionParam4Description->setText("repeat min");
	m_actionParam5Description->setText("repeat max");
	m_actionParam6Description->setText("chance");
			break;
		case SMART_ACTION_PLAYMOVIE:
	m_actionParam1Description->setText("entry");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_MOVE_TO_POS:
	m_actionParam1Description->setText("PointID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_RESPAWN_TARGET:
	m_actionParam1Description->setText("respawntime (second) for GO");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_EQUIP:
	m_actionParam1Description->setText("creature_equip_template.entry");
	m_actionParam2Description->setText("slotmask");
	m_actionParam3Description->setText("slot1 (item_template.entry)");
	m_actionParam4Description->setText("slot2 (item_template.entry)");
	m_actionParam5Description->setText("slot3 (item_template.entry)");
			m_actionParam6Description->setText("");
			break;
		case SMART_ACTION_CLOSE_GOSSIP:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_TRIGGER_TIMED_EVENT:
	m_actionParam1Description->setText("id (>1)");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_TIMED_EVENT:
	m_actionParam1Description->setText("id (>1)");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_AURA:
	m_actionParam1Description->setText("spell ID");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_SCRIPT_RESET:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_RANGED_MOVEMENT:
	m_actionParam1Description->setText("attackDistance");
	m_actionParam2Description->setText("attackAngle");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_CALL_TIMED_ACTIONLIST:
	m_actionParam1Description->setText("EntryOrGUID");
	m_actionParam2Description->setText("0 OOC, 1 IC, 2 always");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_NPC_FLAG:
	m_actionParam1Description->setText("creature_template.npcflag");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_NPC_FLAG:
	m_actionParam1Description->setText("creature_template.npcflag");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_NPC_FLAG:
	m_actionParam1Description->setText("creature_template.npcflag");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SIMPLE_TALK:
	m_actionParam1Description->setText("creature_text.groupid");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_INVOKER_CAST:
	m_actionParam1Description->setText("spell ID");
	m_actionParam2Description->setText("cast flags");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_CROSS_CAST:
	m_actionParam1Description->setText("spell ID");
	m_actionParam2Description->setText("cast flags");
	m_actionParam3Description->setText("CasterTargetType");
	m_actionParam4Description->setText("CasterTarget (target_param1)");
	m_actionParam5Description->setText("CasterTarget (target_param2)");
	m_actionParam6Description->setText("CasterTarget (target_param3)");
			break;
		case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST:
	m_actionParam1Description->setText("EntryOrGUID1");
	m_actionParam2Description->setText("EntryOrGUID2");
	m_actionParam3Description->setText("EntryOrGUID3");
	m_actionParam4Description->setText("EntryOrGUID4");
	m_actionParam5Description->setText("EntryOrGUID5");
	m_actionParam6Description->setText("EntryOrGUID6");
			break;
		case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST:
	m_actionParam1Description->setText("EntryOrGUID min");
	m_actionParam2Description->setText("EntryOrGUID max");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_RANDOM_MOVE:
	m_actionParam1Description->setText("max distance");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_UNIT_FIELD_BYTES_1:
	m_actionParam1Description->setText("value");
	m_actionParam2Description->setText("type");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1:
	m_actionParam1Description->setText("value");
	m_actionParam2Description->setText("type");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_INTERRUPT_SPELL:
	m_actionParam1Description->setText("with delay (0/1)");
	m_actionParam2Description->setText("spell ID");
	m_actionParam3Description->setText("instant (0/1)");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SEND_GO_CUSTOM_ANIM:
	m_actionParam1Description->setText("animprogress (0-255)");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_DYNAMIC_FLAG:
	m_actionParam1Description->setText("dynamic flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_DYNAMIC_FLAG:
	m_actionParam1Description->setText("dynamic flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_DYNAMIC_FLAG:
	m_actionParam1Description->setText("dynamic flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_JUMP_TO_POS:
	m_actionParam1Description->setText("speed XY");
	m_actionParam2Description->setText("speed Z");
	m_actionParam3Description->setText("target X");
	m_actionParam4Description->setText("target Y");
	m_actionParam5Description->setText("target Z");
			m_actionParam6Description->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SEND_GOSSIP_MENU:
	m_actionParam1Description->setText("gossip_menu_option.menuID");
	m_actionParam2Description->setText("gossip_menu_option.npc_text_id");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_GO_SET_LOOT_STATE:
	m_actionParam1Description->setText("0 not ready, 1 ready,\n2 activated, 3 just deactivated");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SEND_TARGET_TO_TARGET:
	m_actionParam1Description->setText("id");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_HOME_POS:
			m_actionParam1Description->setText("");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam1->setDisabled(true);
	m_actionParam1->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_HEALTH_REGEN:
	m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_ROOT:
	m_actionParam1Description->setText("0/1");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SET_GO_FLAG:
	m_actionParam1Description->setText("gameobject_template.flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_ADD_GO_FLAG:
	m_actionParam1Description->setText("gameobject_template.flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_REMOVE_GO_FLAG:
	m_actionParam1Description->setText("gameobject_template.flags");
			m_actionParam2Description->setText("");
			m_actionParam3Description->setText("");
			m_actionParam4Description->setText("");
			m_actionParam5Description->setText("");
			m_actionParam6Description->setText("");
	m_actionParam2->setDisabled(true);
	m_actionParam2->setText("");
	m_actionParam3->setDisabled(true);
	m_actionParam3->setText("");
	m_actionParam4->setDisabled(true);
	m_actionParam4->setText("");
	m_actionParam5->setDisabled(true);
	m_actionParam5->setText("");
	m_actionParam6->setDisabled(true);
	m_actionParam6->setText("");
			break;
		case SMART_ACTION_SUMMON_CREATURE_GROUP:
		m_actionParam1Description->setText("creature_summon_groups.groupid");
		m_actionParam2Description->setText("attack invoker (0/1)");
		m_actionParam3Description->setText("");
		m_actionParam4Description->setText("");
		m_actionParam5Description->setText("");
		m_actionParam6Description->setText("");
		m_actionParam3->setDisabled(true);
		m_actionParam3->setText("");
		m_actionParam4->setDisabled(true);
		m_actionParam4->setText("");
		m_actionParam5->setDisabled(true);
		m_actionParam5->setText("");
		m_actionParam6->setDisabled(true);
		m_actionParam6->setText("");
		break;
	case SMART_ACTION_SET_POWER:
		m_actionParam1Description->setText("power type");
		m_actionParam2Description->setText("new power");
		m_actionParam3Description->setText("");
		m_actionParam4Description->setText("");
		m_actionParam5Description->setText("");
		m_actionParam6Description->setText("");
		m_actionParam3->setDisabled(true);
		m_actionParam3->setText("");
		m_actionParam4->setDisabled(true);
		m_actionParam4->setText("");
		m_actionParam5->setDisabled(true);
		m_actionParam5->setText("");
		m_actionParam6->setDisabled(true);
		m_actionParam6->setText("");
		break;
	case SMART_ACTION_ADD_POWER:
		m_actionParam1Description->setText("power type");
		m_actionParam2Description->setText("amount");
		m_actionParam3Description->setText("");
		m_actionParam4Description->setText("");
		m_actionParam5Description->setText("");
		m_actionParam6Description->setText("");
		m_actionParam3->setDisabled(true);
		m_actionParam3->setText("");
		m_actionParam4->setDisabled(true);
		m_actionParam4->setText("");
		m_actionParam5->setDisabled(true);
		m_actionParam5->setText("");
		m_actionParam6->setDisabled(true);
		m_actionParam6->setText("");
		break;
	case SMART_ACTION_REMOVE_POWER:	
		m_actionParam1Description->setText("power type");
		m_actionParam2Description->setText("amount to remove");
		m_actionParam3Description->setText("");
		m_actionParam4Description->setText("");
		m_actionParam5Description->setText("");
		m_actionParam6Description->setText("");
		m_actionParam3->setDisabled(true);
		m_actionParam3->setText("");
		m_actionParam4->setDisabled(true);
		m_actionParam4->setText("");
		m_actionParam5->setDisabled(true);
		m_actionParam5->setText("");
		m_actionParam6->setDisabled(true);
		m_actionParam6->setText("");
		break;
	default:
		QMessageBox::critical(0, "Bad shit happened!", "Something terrible happened selecting an action. Please contact Sanity!");
	}
}

QWizardPage *ScriptGeneratorWizard::targetTypePage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Target Type");
	
	QLabel *label = new QLabel("Now one of the final steps, we're going to set the target for our action.", page);
	label->setWordWrap(true);
	layout->addWidget(label);
	
	m_comboTarget = new QComboBox(page);
	layout->addWidget(m_comboTarget);
	m_comboTarget->addItem("None");
	m_comboTarget->addItem("Self");
	m_comboTarget->addItem("Victim (current target)");
	m_comboTarget->addItem("Second Aggro");
	m_comboTarget->addItem("Last Aggro");
	m_comboTarget->addItem("Random Hostile");
	m_comboTarget->addItem("Random Hostile not Victim");
	m_comboTarget->addItem("Invoker");
	m_comboTarget->addItem("Position");
	m_comboTarget->addItem("Creature Range");
	m_comboTarget->addItem("Creature GUID");
	m_comboTarget->addItem("Creature Distance");
	m_comboTarget->addItem("Stored");
	m_comboTarget->addItem("GameObject Range");
	m_comboTarget->addItem("GameObject GUID");
	m_comboTarget->addItem("GameObject Distance");
	m_comboTarget->addItem("Invoker Party");
	m_comboTarget->addItem("Player Range");
	m_comboTarget->addItem("Player Distance");
	m_comboTarget->addItem("Closest Creature");
	m_comboTarget->addItem("Closest GameObject");
	m_comboTarget->addItem("Closest Player");
	m_comboTarget->addItem("Invoker Vehicle");
	m_comboTarget->addItem("Owner or Summoner");
	m_comboTarget->addItem("Threat List");
	m_comboTarget->addItem("Closest Enemy");
	
	return page;
}

QWizardPage *ScriptGeneratorWizard::targetParametersPage(){
	QWizardPage *page = new QWizardPage(this);

	QGridLayout *layout = new QGridLayout(page);
	page->setLayout(layout);

	page->setTitle("Target Parameters");
	
	QLabel *label = new QLabel("Now lastly, it's possibly required to set some parameters describing your target. If so, please fill them out, required parameters should be documented.", page);
	label->setWordWrap(true);
	layout->addWidget(label, 0, 0, 1, 12);
	
	m_editTarget1 = new QLineEdit(page);
	m_editTarget1->setValidator(new QIntValidator(this));
	layout->addWidget(m_editTarget1, 1, 0, 1, 4);
	
	m_editTarget2 = new QLineEdit(page);
	m_editTarget2->setValidator(new QIntValidator(this));
	layout->addWidget(m_editTarget2, 1, 4, 1, 4);
	
	m_editTarget3 = new QLineEdit(page);
	m_editTarget3->setValidator(new QIntValidator(this));
	layout->addWidget(m_editTarget3, 1, 8, 1, 4);
	
	m_targetDescription1 = new QLabel("", page);
	layout->addWidget(m_targetDescription1, 2, 0, 1, 4);
	m_targetDescription2 = new QLabel("", page);
	layout->addWidget(m_targetDescription2, 2, 4, 1, 4);
	m_targetDescription3 = new QLabel("", page);
	layout->addWidget(m_targetDescription3, 2, 8, 1, 4);
	
	m_labelX = new QLabel("X: ", page);
	layout->addWidget(m_labelX, 3, 0, 1, 1);
	
	m_editTargetX = new QLineEdit(page);
	m_editTargetX->setValidator(new QDoubleValidator(this));
	layout->addWidget(m_editTargetX, 3, 1, 1, 2);
	
	m_labelY = new QLabel("Y: ", page);
	layout->addWidget(m_labelY, 3, 3, 1, 1);
	
	m_editTargetY = new QLineEdit(page);
	m_editTargetY->setValidator(new QDoubleValidator(this));
	layout->addWidget(m_editTargetY, 3, 4, 1, 2);
	
	m_labelZ = new QLabel("Z: ", page);
	layout->addWidget(m_labelZ, 3, 6, 1, 1);
	
	m_editTargetZ = new QLineEdit(page);
	m_editTargetZ->setValidator(new QDoubleValidator(this));
	layout->addWidget(m_editTargetZ, 3, 7, 1, 2);
	
	m_labelO = new QLabel("O: ", page);
	layout->addWidget(m_labelO, 3, 9, 1, 1);
	
	m_editTargetO = new QLineEdit(page);
	m_editTargetO->setValidator(new QDoubleValidator(this));
	layout->addWidget(m_editTargetO, 3, 10, 1, 2);
	
	return page;
}

QWizardPage *ScriptGeneratorWizard::commentsPage(){
	QWizardPage *page = new QWizardPage(this);

	QVBoxLayout *layout = new QVBoxLayout(page);
	page->setLayout(layout);

	page->setTitle("Comments");
	
	QLabel *label = new QLabel("Last thing and I'll stop bothering you. Please fill in a comment for this event-action combination. A good example of a comment would be\n\n\"MOB XYZ: On receive /kiss emote CAST marriage.\"\n\nPlease keep in mind others may see your scripts and WILL want to read your comment!", page);
	label->setWordWrap(true);
	layout->addWidget(label);
	
	m_comments = new QLineEdit("", page);
	layout->addWidget(m_comments);
	
	return page;
}

void ScriptGeneratorWizard::setTargetTypeParameters(int current){
	printf("setTargetTypeParameters(%d)\n", current);
	m_targetDescription1->setText("");
	m_editTarget1->setDisabled(true);
	m_editTarget1->setText("");
	m_targetDescription2->setText("");
	m_editTarget2->setDisabled(true);
	m_editTarget2->setText("");
	m_targetDescription3->setText("");
	m_editTarget3->setDisabled(true);
	m_editTarget3->setText("");
	m_editTargetX->setText("");
	m_editTargetX->setDisabled(true);
	m_editTargetY->setText("");
	m_editTargetY->setDisabled(true);
	m_editTargetZ->setText("");
	m_editTargetZ->setDisabled(true);
	m_editTargetO->setText("");
	m_editTargetO->setDisabled(true);
	switch(current){
        case SMART_TARGET_NONE:
            break;
        case SMART_TARGET_SELF:
            break;
        case SMART_TARGET_VICTIM:
            break;
        case SMART_TARGET_HOSTILE_SECOND_AGGRO:
            break;
        case SMART_TARGET_HOSTILE_LAST_AGGRO:
            break;
        case SMART_TARGET_HOSTILE_RANDOM:
            break;
        case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
            break;
        case SMART_TARGET_ACTION_INVOKER:
            break;
        case SMART_TARGET_POSITION:
            m_targetDescription1->setText("fill in xyzo below");
            m_editTargetX->setEnabled(true);
            m_editTargetY->setEnabled(true);
            m_editTargetZ->setEnabled(true);
            m_editTargetO->setEnabled(true);
            break;
        case SMART_TARGET_CREATURE_RANGE:
            m_targetDescription1->setText("creature entry (0 if any)");
            m_targetDescription2->setText("min range");
            m_targetDescription3->setText("max range");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            m_editTarget3->setEnabled(true);
            break;
        case SMART_TARGET_CREATURE_GUID:
            m_targetDescription1->setText("GUID");
            m_targetDescription2->setText("entry");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_CREATURE_DISTANCE:
            m_targetDescription1->setText("creature entry");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_STORED:
            m_targetDescription1->setText("ID");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_GAMEOBJECT_RANGE:
            m_targetDescription1->setText("GO entry");
            m_targetDescription2->setText("min dist");
            m_targetDescription3->setText("max dist");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            m_editTarget3->setEnabled(true);
            break;
        case SMART_TARGET_GAMEOBJECT_GUID:
            m_targetDescription1->setText("GUID");
            m_targetDescription2->setText("entry");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_GAMEOBJECT_DISTANCE:
            m_targetDescription1->setText("GO entry (0 if any)");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_INVOKER_PARTY:
            break;
        case SMART_TARGET_PLAYER_RANGE:
            m_targetDescription1->setText("min dist");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_PLAYER_DISTANCE:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_CREATURE:
            m_targetDescription1->setText("entry (0 if any)");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("dead? (0/1)");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            m_editTarget3->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_GAMEOBJECT:
            m_targetDescription1->setText("GO entry");
            m_targetDescription2->setText("max dist");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            m_editTarget2->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_PLAYER:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_ACTION_INVOKER_VEHICLE:
            break;
        case SMART_TARGET_OWNER_OR_SUMMONER:
            break;
        case SMART_TARGET_THREAT_LIST:
            break;
        case SMART_TARGET_CLOSEST_ENEMY:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        case SMART_TARGET_CLOSEST_FRIENDLY:
            m_targetDescription1->setText("max dist");
            m_targetDescription2->setText("");
            m_targetDescription3->setText("");
            m_editTarget1->setEnabled(true);
            break;
        default:
            QMessageBox::critical(0, "Bad shit happened!", "Something terrible happened selecting a target. Please contact Sanity!");
	}
}
